﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using RemoteInterface;


namespace CloudFileSync
{
    public partial class CloudForm : Form
    {

        StringBuilder uploadingFiles = new StringBuilder();

        public CloudForm()
        {
            InitializeComponent();

            TcpChannel channel = new TcpChannel(8085);
            ChannelServices.RegisterChannel(channel, false);
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(RemoteWrapper.RemotingClass), "RemotingClass", WellKnownObjectMode.SingleCall);

            //System.Console.WriteLine("Press Enter key to exit");
            //System.Console.ReadLine();

        }

        private void CloudForm_Load(object sender, EventArgs e)
        {

        }

        private void btnLstFiles_Click(object sender, EventArgs e)
        {
            string[] filenames = uploadingFiles.ToString().Split('\n');
            lstFiles.Items.Clear();
            foreach (string filename in filenames)
            {
                lstFiles.Items.Add(filename);
            }
        }

    }
}
